﻿{include file="public/header" /}
{css href="__ROOT__/static/public/umeditor/themes/default/css/umeditor.css" /}
{js href="__ROOT__/static/public/umeditor/third-party/template.min.js" /}
{js href="__ROOT__/static/public/umeditor/umeditor.config.js" /}
{js href="__ROOT__/static/public/umeditor/umeditor.min.js" /}
<script>
    //city canshu
    var pid = '{:input("get.pid")}';
    var cid = '{:input("get.cid")}';
    var aid = '{:input("get.aid")}';
    var selectc = true;
    var selecta = true;
    function select_a() {
        location.href = '?pid=' + pid + '&cid=' + cid + '&aid=' + aid;
    }
</script>
{if input('get.aid')}
{if input('get.title') == '' || input('get.title') == '邀请送好礼'}
<form method="post" class="form-x">
    <div class="panel admin-panel">
        <div class="panel-head"><strong>{:lang('currency')['edit']}</strong></div>
        <br/>
        <div class="form-group">
            <div class="label">
                <label>{:lang('currency')['city']}</label>
            </div>
            <div class="field">
                {include file="public/city" /}
            </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>活动名称</label>
            </div>
            <div class="field">
                <select name="title" class="input input-auto" onchange="location.href='?pid={:input("get.pid")}&cid={:input("get.cid")}&aid={:input("get.aid")}&title='+this.value;">
                    <option value="">请选择活动</option>
                    <option value="邀请送好礼" {if input('get.title') == '邀请送好礼' || !input('get.title')}selected{/if}>邀请送好礼</option>
                    <option value="新用户注册" {if input('get.title') == '新用户注册'}selected{/if}>新用户注册</option>
                <option value="分享订单" {if input('get.title') == '分享订单'}selected{/if}>分享订单</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>红包</label>
            </div>
            <div class="field">
                {volist name="redpacketlist" id="redpacket"}
                <input {if in_array($redpacket.id,$data['redpacket'])}checked{/if} id="red_{$redpacket.id}" type="checkbox" name="redpacket[]" value="{$redpacket.id}"><label for="red_{$redpacket.id}">{$redpacket.title}</label>
                {/volist}
            </div>
        </div>
       <div class="form-group">
            <div class="label">
                <label>{:lang('label')['content']}</label>
            </div>
            <div class="field">
                <textarea class="input input-auto" name="description" style="min-width: 580px;min-height: 219px">{$data.description}</textarea>
            </div>
       </div>
        <div class="form-group">
            <div class="label">
                <label>{:lang('label')['status']}</label>
            </div>
            <div class="field">
                <div class="button-group button-group-small radio">
                    <label class="button {if $data.status == 1}active{/if}">
                        <input name="status" value="1" {if $data.status== 1}checked="checked" {/if} type="radio">
                        <span class="icon icon-check"></span> {:lang('currency')['status_1']}
                    </label>
                    <label class="button {if $data.status == 0 || !$data.status}active{/if}">
                        <input name="status" value="0" {if $data.status== 0 || !$data.status}checked="checked" {/if}
                        type="radio">
                        <span class="icon icon-times"></span> {:lang('currency')['status_2']}
                    </label>
                </div>
            </div>
        </div>
        <div class="form-button">
            <button class="button bg-main" type="submit">{:lang('form')['submit']}</button>
        </div>
        <br/>
        </div>
    </div>
</form>
{elseif input('get.title') == '新用户注册'}
<form method="post" class="form-x">
    <div class="panel admin-panel">
        <div class="panel-head"><strong>{:lang('currency')['edit']}</strong></div>
        <br/>
        <div class="form-group">
            <div class="label">
                <label>{:lang('currency')['city']}</label>
            </div>
            <div class="field">
                {include file="public/city" /}
            </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>活动名称</label>
            </div>
            <div class="field">
                <select name="title" class="input input-auto" onchange="location.href='?pid={:input("get.pid")}&cid={:input("get.cid")}&aid={:input("get.aid")}&title='+this.value;">
                <option value="">请选择活动</option>
                <option value="邀请送好礼" {if input('get.title') == '邀请送好礼' || !input('get.title')}selected{/if}>邀请送好礼</option>
                <option value="新用户注册" {if input('get.title') == '新用户注册'}selected{/if}>新用户注册</option>
                <option value="分享订单" {if input('get.title') == '分享订单'}selected{/if}>分享订单</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>红包</label>
            </div>
            <div class="field">
                {volist name="redpacketlist" id="redpacket"}
                <input {if in_array($redpacket.id,$data['redpacket'])}checked{/if} id="red_{$redpacket.id}" type="checkbox" name="redpacket[]" value="{$redpacket.id}"><label for="red_{$redpacket.id}">{$redpacket.title}</label>
                {/volist}
            </div>
        </div>
        <div class="form-group">
            <div class="input-inline clearfix">
                <div class="label">
                    <label for="image">{:lang('label')['image']}</label>
                </div>
                <div class="field">
                    <img width="300" height="120" src="{$data.image}" alt="显示图像">
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="input-inline clearfix">
                <div class="label">
                    <label for="image"></label>
                </div>
                <div class="field">
                    <input type="text" readonly class="input input-auto" id="image" name="image" value="{$data.image}" size="30" placeholder="{:lang('label')['image']}" required/>
                    <span class="addbtn"><button type="button" data-id="image" class="button upload">{:lang('form')['file']}</button></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>{:lang('label')['status']}</label>
            </div>
            <div class="field">
                <div class="button-group button-group-small radio">
                    <label class="button {if $data.status == 1}active{/if}">
                        <input name="status" value="1" {if $data.status== 1}checked="checked" {/if} type="radio">
                        <span class="icon icon-check"></span> {:lang('currency')['status_1']}
                    </label>
                    <label class="button {if $data.status == 0 || !$data.status}active{/if}">
                        <input name="status" value="0" {if $data.status== 0 || !$data.status}checked="checked" {/if}
                        type="radio">
                        <span class="icon icon-times"></span> {:lang('currency')['status_2']}
                    </label>
                </div>
            </div>
        </div>
        <div class="form-button">
            <button class="button bg-main" type="submit">{:lang('form')['submit']}</button>
        </div>
        <br/>
    </div>
    </div>
</form>
{elseif input('get.title') == '分享订单'}
<form method="post" class="form-x">
    <div class="panel admin-panel">
        <div class="panel-head"><strong>{:lang('currency')['edit']}</strong></div>
        <br/>
        <div class="form-group">
            <div class="label">
                <label>{:lang('currency')['city']}</label>
            </div>
            <div class="field">
                {include file="public/city" /}
            </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>活动名称</label>
            </div>
            <div class="field">
                <select name="title" class="input input-auto" onchange="location.href='?pid={:input("get.pid")}&cid={:input("get.cid")}&aid={:input("get.aid")}&title='+this.value;">
                <option value="">请选择活动</option>
                <option value="邀请送好礼" {if input('get.title') == '邀请送好礼' || !input('get.title')}selected{/if}>邀请送好礼</option>
                <option value="新用户注册" {if input('get.title') == '新用户注册'}selected{/if}>新用户注册</option>
                <option value="分享订单" {if input('get.title') == '分享订单'}selected{/if}>分享订单</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>红包</label>
            </div>
            <div class="field">
                {volist name="redpacketlist" id="redpacket"}
                <input {if in_array($redpacket.id,$data['redpacket'])}checked{/if} id="red_{$redpacket.id}" type="checkbox" name="redpacket[]" value="{$redpacket.id}"><label for="red_{$redpacket.id}">{$redpacket.title}</label>
                {/volist}
            </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>{:lang('label')['status']}</label>
            </div>
            <div class="field">
                <div class="button-group button-group-small radio">
                    <label class="button {if $data.status == 1}active{/if}">
                        <input name="status" value="1" {if $data.status== 1}checked="checked" {/if} type="radio">
                        <span class="icon icon-check"></span> {:lang('currency')['status_1']}
                    </label>
                    <label class="button {if $data.status == 0 || !$data.status}active{/if}">
                        <input name="status" value="0" {if $data.status== 0 || !$data.status}checked="checked" {/if}
                        type="radio">
                        <span class="icon icon-times"></span> {:lang('currency')['status_2']}
                    </label>
                </div>
            </div>
        </div>
        <div class="form-button">
            <button class="button bg-main" type="submit">{:lang('form')['submit']}</button>
        </div>
        <br/>
    </div>
    </div>
</form>
{/if}
{else}
<script>
    function select_a() {
        location.href = '?pid=' + pid + '&cid=' + cid + '&aid=' + aid;
    }
</script>
<form method="post" class="form-x">
    <div class="panel admin-panel" style="border: none">
        <br>
        <div class="form-group">
            <div class="label">
                <label>{:lang('currency')['city']}</label>
            </div>
            <div class="field">
                {include file="public/city" /}
            </div>
        </div>
        <div class="form-group" style="margin-bottom: 10px">
            <div class="label">
                <label></label>
            </div>
            <div class="field">
                请选择城市后设置
            </div>
        </div>
    </div>
</form>
{/if}
{include file="public/footer" /}